<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no"/>
    <title>确认付款</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <style>
        body {
            background: transparent;
            font-size: 16px;
            overflow: auto;

        }

        /*::-webkit-scrollbar{display:none;}*/
        .payContain {
            overflow: hidden;
        }

        .aui-nav {
            height: auto;
        }

        .aui-icon-left {
            padding-left: 10px;
        }

        .aui-iconfont {
            position: absolute;
        }

        .content {
            display: inline-block;
        }

        .contents {
            margin-left: 25px;
            margin-right: 15px;
            text-align: left;
        }

        .contents > span {
            display: block;
        }

        .icon {
            position: absolute;
            top: 50%;
            text-align: center;
            -webkit-transform: translateY(-50%);
            transform: translateY(-50%);
        }

        .address {
            margin-top: 4px;
        }

        .addressTop.aui-tab-nav li {
            line-height: inherit;
            height: auto;
            position: relative;
            padding: 15px;
            width: 100%;
            color: #fff;
        }

        .aui-tab-nav {
            height: inherit;
            display: block;
            background: #4f6ea6;
        }

        .haderTitle li > span {
            float: left;
            display: block;
        }

        .detail {
            overflow: hidden;
            padding: 5px 15px;
        }

        .good-pirce {
            color: #ff0005;
            font-weight: bold;
        }

        .total {
            margin-top: 10px;
        }

        .haderTitle li > span {
            float: left;
            display: block;
        }

        .contain {
            margin-top: 45px;
            margin-bottom: 140px;
        }

        .contain .aui-tab-nav li {
            line-height: inherit;
            height: auto;
            position: relative;
            padding: 15px;
            width: 100%;
        }

        .contain .aui-tab-nav {
            height: inherit;
            display: block;
        }

        .contents {
            margin-left: 25px;
            margin-right: 15px;
            text-align: left;
        }

        .content {
            display: inline-block;
        }

        .contents > span {
            display: block;
        }

        .time {
            display: block;
        }

        .icon {
            position: absolute;
            top: 50%;
            text-align: center;
            -webkit-transform: translateY(-50%);
            transform: translateY(-50%);
        }

        .address {
            margin-top: 8px;
        }

        .good {
            background: #fff;
            margin-bottom: 15px;
        }

        .good-pirce {
            color: #ff0005;
            font-weight: bold;
        }

        .good-info-list {
            color: #a3a3a3;
            font-size: 12px;
            line-height: 1.4;
        }

        .company-name {
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            background: #fff;
            padding-left: 15px;
            position: relative;
        }

        .good_bottom {
            /*padding: 15px;*/
        }

        .good_bottom ul li {
            overflow: hidden;
            margin-bottom: 5px;
        }

        .good_bottom ul li span {
            display: block;
        }

        .shiji {
            font-weight: bold;
            font-size: 18px;
        }

        .good-info .aui-list-view {
            margin: 0;
        }

        .checkCard .aui-list-view {
            /*margin-bottom: 65px;*/
        }

        .contact {
            overflow: hidden;
        }

        .contactMeg, .contactPhone {
            display: block;
            padding: 5px 30px;
            border: 1px solid #9c9c9c;
            float: left;
            width: 48%;
            margin-top: 10px;
        }

        .contactMeg {
            margin-right: 2%;
        }

        .menuRgiht {
            float: right;
            margin-right: 20px;
        }

        .good_bottom {
            background: #fff;
        }

        .aui-iconfont {
            margin-right: 5px;
        }

        .total {
            margin-top: 15px;
            margin-bottom: 10px;
        }

        .total .good-pirce {
            font-size: 18px;
        }

        input[type="text"] {
            margin: 0;
        }

        .waitingTips {
            width: 100%;
            background: #ffd9cd;
            text-align: center;
            height: 25px;
            line-height: 25px;
            overflow: hidden;
            color: #ff6868;
            font-size: 12px;
        }

        /*下面弹出的样式*/
        .pickerToTop {
            position: fixed;
            bottom: 0;
            min-height: 250px;
            overflow-y: auto;
            -webkit-transition: .5s;
            transition: .5s;
            z-index: 999;
            text-align: center;
            background: #fff;
            width: 200%;
        }

        .toTopAnimate {
            -webkit-transform: translateY(00px);
        }

        .pickerToTop .aui-list-view-cell:not(:first-of-type) {
            text-align: left;
        }

        /*.pickerToTop .aui-list-view-cell:last-of-type:after{
            border: 0;
        }*/
        .pickerToTop .myBtn {
            position: fixed;
            bottom: 0;
            /*width: 50%;*/
        }

        .myBorder {
            /*height: 8px;*/
            /*background: #797979;*/
        }

        .paw {
            background: url(../../image/pawbg.jpg);
            background-size: contain;
            margin: 0 auto;
            width: 270px !important;
            letter-spacing: 40px;
        }

        .pickerToTop .aui-iconfont {
            position: absolute;
            left: 10px;
            top: 10px;
            font-size: 20px;
            color: #000;
            z-index: 9;
        }

        .pay, .checkCard {
            float: left;
            width: 50%;
            position: relative;
        }

        .pickerToTop .aui-list-view-cell:after {
            /*border: 0;*/
        }

        .title {
            background: #fff;
            padding: 15px;
        }

        .good_bottom .aui-list-view:after {
            border: 0;
        }

        span.xiaoji {
            position: relative;
            display: block;
            padding: 0 8px;
        }

        span.xiaoji:nth-of-type(2):before {
            position: absolute;
            content: "";
            width: 1px;
            background: #b6b6b6;
            top: 2px;
            right: 0;
            bottom: 2px;
        }

        .good-info {
            margin-bottom: 15px;
        }

        .checkCard .myBtn {
            background: none;
            color: #000;
            width: 50%;
            color: #fff;
        }

        .pickerToTop2 {
            transition: 0.5s;
            min-height: 250px;
        }

        .showCar {
            -webkit-transform: translateX(-50%);
        }

        .pickerToTop ul li:not(:first-of-type) {
            font-size: 14px;
        }

        .payList li {
            position: relative;

        }

        .payList li img {
            width: 25px;
            vertical-align: middle;
            margin-right: 5px;
        }

        .payList li.payActive:before {
            content: "\e645";
            font-family: "auiicon" !important;
            right: 20px;
            position: absolute;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            color: #327afa;
            border: 1px solid #327afa;
            line-height: 20px;
            text-align: center;
        }

        .pickerToTop2 {
            width: 100%;
            overflow: hidden;
            height: inherit;
        }

        .btnAddCard {
            z-index: 99;
            position: relative !important;
            width: 100% !important;
        }

        .result {
            display: none;
            padding: 15px;
            padding-top: 100px;
            background: #fff;
            height: 100%;
        }

        .spanOk {
            display: block;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            background: #ff3333;
            position: relative;
            margin: 0 auto;
            margin-bottom: 10px;
        }

        .spanOk:before {
            position: absolute;
            content: "\e645";
            left: 26%;
            top: 10%;
            color: #fff;
            font-size: 25px;
        }

        .ok {
            text-align: center;
            padding-bottom: 15px;
            margin-bottom: 15px;
        }

        .result .aui-btn {
            width: 45%;
            float: left;
            margin-top: 15px;
            margin-right: 10px;
            overflow: hidden;
        }

        .result .waring {
            font-size: 12px;
            color: #646464;
            overflow: hidden;
            margin-top: 15px;
            width: 100%;
        }

        .btns {
            overflow: hidden;
        }

        .bodyLayer {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 998;
            background-color: rgba(0, 0, 0, .3);
        }

        .sure {
            position: fixed;
        }
    </style>
</head>

<body>
<div class="bodyLayer"></div>
<!--<header class="aui-bar aui-bar-nav aui-border-b">-->
<!--<div class="aui-pull-left aui-iconfont aui-icon-left icon-left-coler" tapmode onclick="closeWin()"></div>-->
<!--<div class="aui-title">确认支付</div>-->
<!--</header>-->
<div class="pickerToTop">
    <div class="pickerToTop2">
        <div class="pay">
            <i class="aui-iconfont aui-icon-roundclose"></i>
            <ul class="aui-list-view ">
                <li class="aui-list-view-cell">
                    付款详情
                </li>
                <li class="aui-list-view-cell">
                    <!--<li class="aui-list-view-cell" tapmode onclick="showCheckCard()">-->
                    <a class="aui-arrow-right">
                        支付方式
                        <span class="menuRgiht payMethod">支付宝支付</span>
                    </a>
                </li>
                <li class="aui-list-view-cell">
                    <a class="">
                        需付款
                        <span class="menuRgiht">￥<em class="payMoney"></em></span>
                    </a>
                </li>
            </ul>
            <div class="myBtn sure" tapmode onclick="comfirmPay()">确认付款</div>
        </div>
        <div class="checkCard">
            <i class="aui-iconfont aui-icon-left" tapmode onclick="showCheckCardBack()"></i>
            <ul class="aui-list-view payList">
                <li class="aui-list-view-cell">
                    付款详情
                </li>
                <li class="aui-list-view-cell payActive" tapmode onclick="checkCardFn(this)">
                    <img src="../../icon/AliPayIcon.png">支付宝支付
                </li>
                <li class="aui-list-view-cell" tapmode onclick="checkCardFn(this)">
                    <img src="../../icon/CMBIcon.png">招商银行储蓄卡（2130）
                </li>
                <li class="aui-list-view-cell" tapmode onclick="checkCardFn(this)">
                    <img src="../../icon/BOCIcon.png">中国银行储蓄卡（6050）
                </li>
                <li class="aui-list-view-cell" tapmode onclick="checkCardFn(this)">
                    <img src="../../icon/ABCIcon.png">中国农业银行储蓄卡（1480）
                </li>
            </ul>
            <!-- <div class="myBtn aui-border-t btnAddCard" tapmode onclick="openToTwo('my/addCard')">+添加新卡付款</div> -->
            <div class="myBtn aui-border-t btnAddCard" tapmode onclick="openToTwo('addCard');hidePicker()">
                +添加新卡付款
            </div>
        </div>
    </div>
</div>
<!-- 控制影藏显示 -->
<div class="result">
    <div class="ok aui-border-b">
        <span class="aui-iconfont aui-icon-check spanOk"></span>

        <p>支付成功</p>
    </div>
    <div class="resultTips">
        <h3>发货信息</h3>

        <p>我们将尽快安排发货，请买家保持手机通讯畅通，以便快递哥哥能第一时间联系到您。</p>
    </div>
    <div class="btns">
        <div class="aui-btn aui-btn-info aui-btn-block aui-btn-outlined" tapmode onclick="goToRoot()">
            返回
        </div>
        <div class="aui-btn aui-btn-info aui-btn-block aui-btn-outlined" tapmode onclick="goToHome(0)">
            去首页
        </div>
    </div>
    <div class="waring">
        <em style="color:#ff3333">＊</em>安全提醒：中纺互联不会以任何理由要求您提供银行卡信息或支付额外费用，请谨防钓鱼链接或诈骗电话。
    </div>
</div>

</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript" src="../../script/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../../script/mui.js"></script>
<script type="text/javascript" src="../../script/index.js"></script>
<script type="text/javascript">
    var companyId, companyName, money, orderId, orderNo;
    apiready = function () {
        api.parseTapmode();
        money = api.pageParam.money;
        orderId = api.pageParam.orderId;
        orderNo = api.pageParam.orderNo;
        $(".payMoney").text(money)
        //验证地址
        getStorageAll();
        //商品订单列表
//        alert(orderId)
    }

    //商品订单列表
function goToRoot() {
    api.closeToWin({name:'root'})
}

    function checkCardFn(obj) {
        $(obj).parent().find("li").removeClass("payActive");
        $(obj).addClass("payActive");
        $(".payMethod").text($(obj).text());
        showCheckCardBack();
    }
    // 右滑选择银行卡
    function showCheckCard() {
        $(".pickerToTop2").addClass("showCar");
    }
    // 右滑选择银行卡
    function showCheckCardBack() {
        $(".pickerToTop2").removeClass("showCar");
    }
    // 支付成功
    function comfirmPay() {
        //支付成功更新订单状态
//        api.closeToWin({
//            name:"goToOrderList"
//        });


        var obj = api.require('aliPay');
        obj.pay({
            partner: '2088521533072680',
            seller: 'zgfz1688@163.com',
            rsaPriKey: 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANy7iNSahQiIxbSiTQwldMMTAflFsP/+6tp9Dn134wstExY6cTLYyNqZOq87cZBOyRuv1n3QNUNJcgrZoAUaCLvvcgXC11ZfXRTY3URh1HDY9q5rv1nofLQQ1YAugGu149YVu7fvoQ9z/HMNdFntgb2CipwtfQAPqMxG76mQ9ulLAgMBAAECgYEA0EOVX9uHR70cpUk5Xwt8No6ZnyNVVMSlvI6f/FwAecwGpUNxCOOn5zEKQMnaZakgcSIgQ8cOajVDB9+77vRYZZExAo72VZhaJ+aE0WHLnW4blpkZPCxTENDHjnKhl9IH1o8kDOXMzP8F7BDfFUymI8v0IZuSs5A226o7oy4Gv5ECQQD2dJJESMTQShwKpXVFy9dhyr6isGT1CaLP+f+Tm7cMhp+Cho8sNEsp5qI3SttMntplp6Y5FvpXjDYbKzTVD49DAkEA5UfwobK2ixJbrffam6egSymuejY8i/ONoz1zbB+BRc9LQTHjcFkFAeQwSUm5ZtdI7s7gA33rC5G2mHA2aTxJWQJBAI69Qz2jO8I7OfR8kehjwBHWgATvzvkQpKh57alLJYButBG/50o9206gUlFd3JeK5Yi8yYwFH+b2wRuJMac4xMsCQA/YPd/eytCnjyBhnYDeP6ySD9WwQ9TkGuiqCXzyXGunnKq/uNj9vePYkiGub5qUzBx8vWxgWkrtYfH85zW0jdkCQHAa+lZTk4m33YndZgEsMscvxpVbzbiNr87aBKy1OJHjjQ1jRbnkWVXJG/7HuCFflY/XfPqp+GEcjb2J5EOs0to=',
            rsaPubKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcu4jUmoUIiMW0ok0MJXTDEwH5RbD//urafQ59d+MLLRMWOnEy2MjamTqvO3GQTskbr9Z90DVDSXIK2aAFGgi773IFwtdWX10U2N1EYdRw2Paua79Z6Hy0ENWALoBrtePWFbu376EPc/xzDXRZ7YG9goqcLX0AD6jMRu+pkPbpSwIDAQAB',
            subject: '1000879'+orderNo, //订单名
            body: '1000879'+orderNo, //订单描述
            amount: money, //金额
//            amount: 0.01, //金额
            tradeNO: orderNo, //订单编号
            notifyURL:serverUrl+'Order/aliNotify'
        }, function (ret, err) {
            if (ret.code == 9000) {
                var data = {};
                var url = 'Order/orderStatusModify/userName/' + user_name + '/orderId/' + orderId + '/status/2/type/1';
                ajaxRequest(url, 'post', data, function (ret, err) {
                    if (ret.status == 1) {
                        $(".pickerToTop").css({"display": "none"});
                        $(".result").css({"display": "block"});
                        $(".bodyLayer").hide();
                        $("body").css({"background": "#fff"})
                        updateOrderNum();
                    } else {
                        api.toast({
                            msg: ret.msg,
                            duration: 2000,
                            location: 'bottom'
                        })
                    }
                })
            } else {
                //9000：支付成功
                //4000：系统异常
                //4001：数据格式不正确
                //4003：该用户绑定的支付宝账户被冻结或不允许支付
                //4004：该用户已解除绑定
                //4005：绑定失败或没有绑定
                //4006：订单支付失败
                //4010：重新绑定账户
                //6000：支付服务正在进行升级操作
                //6001：用户中途取消支付操作
                //0001：缺少商户配置信息（商户id，支付公钥，支付密钥）
                //0002：缺少参数（subject、body、amount、tradeNO）
                //0003：签名错误（公钥私钥错误）
                var textMsg = "";
                switch (parseInt(ret.code)) {
                    case 4000:
                        textMsg = "系统异常";
                        break;
                    case 4001:
                        textMsg = "数据格式不正确";
                        break;
                    case 4003:
                        textMsg = "该用户绑定的支付宝账户被冻结或不允许支付";
                        break;
                    case 4004:
                        textMsg = "该用户已解除绑定";
                        break;
                    case 4005:
                        textMsg = "绑定失败或没有绑定";
                        break;
                    case 4006:
                        textMsg = "订单支付失败";
                        break;
                    case 4010:
                        textMsg = "重新绑定账户";
                        break;
                    case 6000:
                        textMsg = "支付服务正在进行升级操作";
                        break;
                    case 6001:
                        textMsg = "已取消支付";
                        break;
                    case 0001:
                        textMsg = "缺少商户配置信息,请联系商家";
                        break;
                    case 0002:
                        textMsg = "缺少参数,请联系商家";
                        break;
                    case 0003:
                        textMsg = "签名错误,请联系商家";
                        break;
                }
                api.toast({
                    msg: textMsg
                })
            }
        });


    }
    function goBack() {
        api.closeWin();
//        api.closeToWin({
//            name: "goToOrderList"
//        });
    }
    $(".bodyLayer,.aui-icon-roundclose").click(function () {
        api.closeFrame();
    })
</script>

</html>
